


def solution(digits):
    if not digits:
        return []
    _map = {
        2:"abc",
        3:"def",
        4:"ghi",
        5:"jkl",
        6:"mno",
        7:"pqrs",
        8:"tuv",
        9:"wxyz",
    }
    # 构造二维数组
    # 237
    dp = [list(_map[i]) for i in map(int,str(digits))]
    # 找所有的组合

    size = len(dp)

    ret = []
    path = []
    def tra(index,path):
        if index == size: # 3
           ret.append("".join(path))
           return
        for i in range(len(dp[index])):

            path.append(dp[index][i])
            tra(index+1,path)
            path.pop()

    tra(0,path)
    return ret


print(solution(23))
print(solution(5))
print(solution(6))
print(solution(2))
print(solution(""))